Class TreeNode<T extends TreeNodeInfo>
java.lang.Object
edu.claflin.finder.algo.clustering.struct.TreeNode<T>
- All Implemented Interfaces:
Comparable<TreeNode<T>>
The basic unit of the BinarySearchTree.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleangetInfo()Get the left child TreeNode.Get the right child TreeNode.voidSet the information of this TreeNode.voidsetLeftChild(TreeNode<T> left) Set the left child TreeNode.voidSet all the information of this TreeNode.voidsetRightChild(TreeNode<T> right) Set the right child TreeNode.toString()
-
Field Details
-
info
-
left
-
right
-
-
Constructor Details
-
TreeNode
public TreeNode() -
TreeNode
Create an empty TreeNode.- Parameters:
info- the information
-
TreeNode
-
-
Method Details
-
getInfo
-
getLeftChild
Get the left child TreeNode.- Returns:
- the left child TreeNode
-
getRightChild
Get the right child TreeNode.- Returns:
- the right child TreeNode
-
setNode
Set all the information of this TreeNode.- Parameters:
info- the informationl- the left child TreeNoder- the right child TreeNode
-
setInfo
Set the information of this TreeNode.- Parameters:
info- the info to set
-
setLeftChild
Set the left child TreeNode.- Parameters:
left- the left child TreeNode
-
setRightChild
Set the right child TreeNode.- Parameters:
right- the right child TreeNode
-
duplicate
-
compareTo
- Specified by:
compareToin interfaceComparable<T extends TreeNodeInfo>
-
equals
-
toString
-